import Cookies from "js-cookie";

const TokenKey = "manage_token";
const userForm = "manage_user";
// 获取 token
export function getToken() {
  return Cookies.get(TokenKey);
}
// 保存 token
export function setToken(token) {
  return Cookies.set(TokenKey, token);
}
// 删除 token
export function removeToken() {
  return Cookies.remove(TokenKey);
}
// 缓存用户信息
export function setUser(form) {
  return localStorage.setItem(userForm, form);
}
// 删除缓存的用户信息
export function removeUser() {
  return localStorage.removeItem(userForm);
}
// 获取缓存用户信息
export function getUser() {
  return localStorage.getItem(userForm);
}

